#ifndef XPARTICLE_EMITER_H
#define XPARTICLE_EMITER_H

#include <XParticle.h>
#include <XInitializationFile.h>
#include <vector>

#ifdef XEXPORTING
#define XEXPORT_DLL __declspec(dllexport)
#else
#define XEXPORT_DLL __declspec(dllimport)
#endif

class XEXPORT_DLL XParticleEmiter
{
protected:
	XPosition Position;

	XInitializationFile File;
	int MaxSprites;
	int CreationTime;
	int ParticleDuration;
	int DeltaUpdate;
	int LastUpdate;
	std::vector<XParticle*> Particle;

	XSprite** Sprite;
	XTexture* Texture;

	XColor StartColor;
	XVector StartRange;
	int MinStartRotation;
	int MaxStartRotation;
	float MinStartScale;
	float MaxStartScale;

	XColor ChangeColor;
	XVector ChangeRange;
	int Height;
	int Width;
	int MinChangeRotation;
	int MaxChangeRotation;
	float MinChangeScale;
	float MaxChangeScale;

	XRectangle* SpriteClip;

	void LoadData();
	void AddParticle(int time);
public:
	XParticleEmiter(std::string path, int time, XPosition pos);

	void SetPosition(XPosition pos);
	virtual void Update(int time);
	virtual void Draw();
};

#endif